Function.prototype.myApply = function (context) {
  const obj = context || window
  obj.fn = this 
  const args = arguments[1] || []
  const res = obj.fn(...args)
  delete obj.fn
  return res
}

//用法：f.call(obj,arg1)
let name = '55555'
function f(a, b) {
  console.log(a + b)
  console.log(this.name)
}
let obj = {
  name: 'wp'
}
f.myApply(obj,[ 1, 2]) //否则this指向window